<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <title>商户暂存查询</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon"/>
    <!-- 当前页面样式 -->
    <link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
    <!-- 当前页面样式 END -->
    <script type="text/javascript" src="<c:url value="/js/jquery-1.3.2.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
	<script type="text/javascript">
	$(document).ready(function() {
		$("#szPower").click(
				function() {
					var dd = $("input[name=multi_sel]:checked");
					if(dd.length != 1){
						alert("只能选择一个商户！");
						return false;
					}
					var accountNo = dd.val();
					if(dd.length == 0){
						alert("请选择商户");
						return false;
					}else{
						$("#queryMerTmpSaveForm").attr("action","<%=basePath%>/merTempSave/merTempSaveComplete.ct?merinfo.id="+accountNo);
						$("#queryMerTmpSaveForm").submit();
				}
		});
	});
	
	function queryForm(obj){
		$("#"+obj.id).attr("disabled",true);
		$("#queryMerTmpSaveForm").submit();
		
	}
	
</script>
</head>
<body>
<s:form id="queryMerTmpSaveForm" action="/merTempSave/merinfoTempSaveList.ct" method="post" theme="simple">
<input type="hidden" id="opid" value="${request.opid}" />
<table class="tb">
	<tbody>
		<tr class="tb-line">
			<td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
		</tr>
		<tr class="tb-line">
			<td class="tb-td" colspan="4"><div class="tb-h3">暂存商户查询</div></td>
		</tr>
		<tr class="tb-line">
		<td align="right" class="tb-td">
			<div class="tb-h4">商户号：</div>
		</td>
		<td class="tb-td">
			<label class="tb-input-normal">
				<s:textfield  name="searchCondition.mchtCd" />
			</label>
		</td>
		<td align="right" class="tb-td">
			<div class="tb-h4">商户简称：</div>
		</td>
		<td class="tb-td">
			<label class="tb-input-normal">
				<s:textfield  name="searchCondition.nameBusi" maxlength="20"/>
			</label>
		</td>
		</tr>
		<tr class="tb-line">
			<td align="right" class="tb-td">创建时间：</td>
			<td class="tb-td" colspan="3">
				<label class="tb-input-normal">
					<s:textfield id="minDate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,wdate:true,errDealMode:0});" name="searchCondition.minDate" />
				</label>
				-
				<label class="tb-input-normal">
					<s:textfield id="maxDate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,wdate:true,errDealMode:0});" name="searchCondition.maxDate" />
				</label>
			</td>
		</tr>
		<tr class="tb-line">
			<td class="tb-td line-submit" align="right" colspan="4">
				<label class="tb-input-submit">
					<input type="button" value="查询" id="queryBtn" onclick='queryForm(this)'/>
				</label>
				<label class="tb-input-submit">
					<input type="reset" value="取消"/>
				</label>
				<label class="tb-input-submit">
					<input id="szPower" type="button"  value="完善信息" />
				</label>
			</td>
		</tr>
		<tr class="tb-line">
			<td class="tb-td line-submit" align="center" colspan="4">
				<font color="red"><s:actionmessage/><s:actionerror/></font>
			</td>
		</tr>
		<s:if test="#request.searchRsList != null && #request.searchRsList.size>0 ">
			<tr class="tb-line">
				<td class="tb-td paging"  align="left" colspan="4"> 
					 	<page:pageCount max_pages="11" totalPage="${requestScope.totalPage}"
						currentPage="${requestScope.currentPage}"
						action="${rootPath}/merTempSave/merinfoTempSaveList.ct?currentPage=" />
				</td>
			</tr>
		</s:if>
    </tbody>
</table>
</s:form>
<div class="big-tb">
	<table class="tb" style="width: 100%;">
		<thead>
			<tr class="tb-line">
				<th class="tb-th" colspan="20">暂存商户基本信息列表</th>
			</tr>
			<tr class="tb-line bg-gray">
				<th class="tb-th">选择</th>
				<th class="tb-th">商户号</th>
				<th class="tb-th">商户简称</th>
				<th class="tb-th">状态</th>
				<th class="tb-th">创建时间</th>
		</tr>
		</thead>
		<tbody>
			<s:iterator value="#request.searchRsList" status="stat" id="sh">
				<tr class="tb-line" >
					<td align="center" class="tb-td">
					<s:if test="#request.opid==#sh.recUpdOpr">
						<s:checkboxlist name="multi_sel" list="#{#sh.mid:''}" theme="simple" />
					</s:if>
					<s:else>
						<s:checkboxlist name="multi_sel" disabled="true" list="#{#sh.mid:''}" theme="simple" />
					</s:else>	
					</td>
					<td class="tb-td"><s:property value="#sh.mid"/></td>
					<td class="tb-td"><s:property value="#sh.merName"/></td>
					<td class="tb-td"><s:property value="#sh.flag"/> </td>
					<td class="tb-td"><s:property value="#sh.setTime"/></td>
				</tr>
			</s:iterator>	
		</tbody>
	</table>
</div>
	<s:if test="#request.msg !=null">
		<script language="javascript">
			alert("${request.msg}");
		</script>
	</s:if>
</body>
</html>